import { get } from '../get'
import { request } from '../request'
import axios from 'axios'
import { SERVER_URL } from '@/util/constant'
import Cookie from 'js-cookie'

export const GetCountryData = (params) => {
    return get.get(`/sysmanage/datadict_name`, { params })
  }

  //查询列表
export const GetworkbaseData = (pageNum, pageSize, searchModel) => {
    return get.get(`/workbase/${pageNum}/${pageSize}`, {
      params: searchModel
    })
  }

  //作业单位
export const GetWorkCompany = (params) => {
    return get.get(`/sysmanage/datadict_name`, { params })
  }

// 区域
export const GetArea = () => {
    return get.get(`/sysmanage/area`)
  }
// 井型
  export const GetWellType = () => {
    return get.get(`/sysmanage/WellType`)
  }

  // 井别
  export const GetWellSpacing = () => {
    return get.get(`/sysmanage/WellSpacing`)
  }

// 创建井眼
export const CreateWell = (data) => {
  return request.post('/workbase/buildWell', data)
}

// 删除
export const DeleteWell = (wellName) => {
  return request.delete(`/workbase/deleteWell/${wellName}`)
}

// 根据井名获取详细信息
export const GetWellDetail = (wellName) => {
  return get.get(`/workbase/getWell/${wellName}`, {
  })
}

// 更新编辑内容
export const updateWell = (data) => {
  return request({
    url:'/workbase/putWell',
    method: 'put',
    headers: {
      'Content-Type' :  'application/json;charset=UTF-8'
    },
    data: data
  })
}

